package com.wyw.design.model.learning.behavioral.command;

/**
 * @Title   执行者 遥控器
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2023/4/17 16:30
 * Update History:
 * Author        Time            Content
 */
public class TvRemote {
    private Command openTvCommand;
    private Command closeTvCommand;
    private Command changeTvCommand;
    public TvRemote(Command openTvCommand, Command closeTvCommand, Command changeTvCommand) {
        this.openTvCommand = openTvCommand;
        this.closeTvCommand = closeTvCommand;
        this.changeTvCommand = changeTvCommand;
    }
    // 打开电视
    public void open() {
        openTvCommand.execute();
    }
    // 关闭电视
    public void close() {
        closeTvCommand.execute();
    }
    // 换频道
    public void change() {
        changeTvCommand.execute();
    }
}
